<?php
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/


get_config_keytable("istration_conference_record_edit");
empty($do) && $do = 'list';
if ($do == 'edit') {
	$id = getGP('id','G','int');
	$conference = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."conference_record  WHERE rid = '$id'");
	include_once('template/isedit.php');

} elseif ($do == 'save') {
	
	$savetype = getGP('savetype','P');
	$id = getGP('id','P','int');
	$contitle=explode('|oa',getGP('subject','P'));
	$conferenceid = $contitle[0];
	$subject = $contitle[1];
	$date = getGP('startdate','P')." ".getGP('starttime1','P').":".getGP('starttime2','P');
	$attendance = getGP('attendance','P');
	$conferenceroom = getGP('conferenceroom','P');
	$attendance = getGP('participation','P');
	$uid=$_USER->id;
	$recordperson = getGP('recordpersonid','P');
	$appendix = getGP('appendix','P');
	$content = getGP('content','P');
	$conference_record = array(
		'conferenceid' => $conferenceid,
		'subject' => $subject,
		'attendance' => $attendance,
		'conferenceroom' => $conferenceroom,
		'recordperson' => $recordperson,
		'appendix' => $appendix,
		'content' => $content
	);
	update_db('conference_record',$conference_record, array('rid' => $id));
	$content=$conferenceid.get_inc_log(1).$subject.get_inc_log(1).$attendance.get_inc_log(1).$conferenceroom.get_inc_log(1).$recordperson.get_inc_log(1).$appendix.get_inc_log(1).$content;
	$title='修改会议记录';
	get_oa_log_dbadd($id,$content,$title,19,$_USER->id);
	goto_page('admin.php?ac=isindex&fileurl=conference');
	

}
function get_conference_options($selid = 0) {
	global $db;
	$html = '';
	$sql = "SELECT id,title FROM ".DB_TABLEPRE."conference order by id desc";
	$query = $db->query($sql);
	while ($row = $db->fetch_array($query)) {
		$selstr = $row['id'] == $selid ? 'selected="selected"' : '';
		$html .= '<option value="'.$row['id'].'|oa'.$row['title'].'" '.$selstr.' >'.$row['title'].'</option>';
	}
	return $html;
}
?>